<?php

namespace App\Http\Controllers\Api\O1\UserCenter\Member;

use Biz\Services\User\UserMemberService;
use Biz\Resources\User\UserMemberResource;
use Biz\Validators\Site\Member\ProfileValidator;
use Laravel\Lumen\Routing\Controller as BaseController;

/**
 * ProfileController.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class ProfileController extends BaseController
{
    /**
     * @var mixed
     */
    protected $service;

    /**
     * RepositoryController constructor.
     *
     * @param UserMemberService $service
     */
    public function __construct(UserMemberService $service)
    {
        $this->service = $service;
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param ProfileValidator $request
     *
     * @return \Illuminate\Http\Response
     */
    public function profile(ProfileValidator $request)
    {
        $userMember = $this->service->profile($request);

        return new UserMemberResource($userMember);
    }
}
